#include<bits/stdc++.h>
#define int long long
#define INF (0x3f3f3f3f3f3f3f3f)
using namespace std;


signed main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int n,a,b;
    cin>>n>>a>>b;
    int sum=0;
    for (int i=0;i<n;i++)
    {
        int x1,y1,x2,y2;
        cin>>x1>>y1>>x2>>y2;
        int x,y;
        x=min(a,x2)- max<int>(0,x1);
        y=min(b,y2)- max<int>(0,y1);
        if (x>0&&y>0)sum+=x*y;
    }
    cout<<sum;
    return 0;
}
